<?php

namespace Core\Session;

class SessionStorage implements ISessionStorage {
    
    private $namespace;
    
    public function __construct($namespace) {
        $this->namespace = $namespace;
    }
    
    public function clear() {
        unset($_SESSION[$this->namespace]);
    }

    public function get($key) {
        return $_SESSION[$this->namespace][$key];
    }

    public function put($key, $value) {
        $_SESSION[$this->namespace][$key] = $value;
    }    
}
